package weaver.jobs.cese.util;

import weaver.common.DateUtil;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Title: Ecology9
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2021-08-18
 * @Description: ${description}
 * @ModifyLog:
 **/

public class CommUtil {
    public static long getDays(String date){
        long days = 0L;
        try{
            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
            Date d1=sdf.parse(date);
            long ts1 = d1.getTime();
            Date d2=sdf.parse(DateUtil.getCurrentDate());
            long ts2 = d2.getTime();
            days = (ts1-ts2)/(1000*60*60*24);
        }catch (Exception e){
            e.printStackTrace();
        }
        return days;
    }
}
